#pragma once
#include"Common.hpp"
#include"ThreadCache.hpp"

static void* ConcurrentAlloc(size_t size)
{
    //每个线程无锁的获取自己的thread对象
    if(pTLSThreadCache==nullptr)
    {
        pTLSThreadCache = new ThreadCache;
    }
    cout<<std::this_thread::get_id()<<":"<<pTLSThreadCache<<endl;
    return pTLSThreadCache->Allocate(size);
}
static void ConcurrentFree(void* ptr,size_t size)//需要知道删除哪个桶
{
    assert(pTLSThreadCache);
    pTLSThreadCache->Dellocate(ptr,size);
}